
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2353. -- 矩形压缩 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2353: 矩形压缩</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>9&nbsp;&nbsp;<span class=green>Solved: </span>4<br>[<a href='submitpage.php?id=2353'>Submit</a>][<a href='problemstatus.php?id=2353'>Status</a>][<a href='bbs.php?id=2353'>Discuss</a>]</center><h2>Description</h2><div class=content><h3 style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-weight: normal; font-size: 12pt; font-family: '黑体'; mso-spacerun: 'yes'"><o:p></o:p></span></h3>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; line-height: 150%"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">平面上给出<font face="Times New Roman">N</font><font face="宋体">个矩形，定义平面内的一个矩形是</font><font face="Times New Roman">cool</font><font face="宋体">的，当且仅当这个矩形的四边完全在给出</font><font face="Times New Roman">N</font><font face="宋体">个矩形的边界上（边界相互重合）。现在你想取</font><font face="Times New Roman">N</font><font face="宋体">个</font><font face="Times New Roman">cool</font><font face="宋体">矩形来一一代表这</font><font face="Times New Roman">N</font><font face="宋体">个矩形。</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; line-height: 150%"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">假如你要用一个<font face="Times New Roman">cool</font><font face="宋体">矩形来代表矩形</font><font face="Times New Roman">I</font><font face="宋体">，那么必须满足这个</font><font face="Times New Roman">cool</font><font face="宋体">矩形完全在</font><font face="Times New Roman">I</font><font face="宋体">之内；要求一个</font><font face="Times New Roman">cool</font><font face="宋体">矩形只能代表一个矩形，并且你选出的代表这</font><font face="Times New Roman">N</font><font face="宋体">个矩形的</font><font face="Times New Roman">N</font><font face="宋体">个</font><font face="Times New Roman">cool</font><font face="宋体">矩形之间，两两不覆盖（边界可以重叠）。</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; line-height: 150%"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">问你选出的<font face="Times New Roman">N</font><font face="宋体">个</font><font face="Times New Roman">cool</font><font face="宋体">矩形的最小面积和，或者返回</font><font face="Times New Roman">-1</font><font face="宋体">，表示无解</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<!--EndFragment--></div><h2>Input</h2><div class=content><p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">输入文件第一行括一个数字<font face="Times New Roman">N</font><font face="宋体">，</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">接下来<font face="Times New Roman">4</font><font face="宋体">行</font><font face="Times New Roman">N</font><font face="宋体">列，每列依次为</font><font face="Times New Roman">4</font><font face="宋体">个数字（</font><font face="Times New Roman">x1</font><font face="宋体">，</font><font face="Times New Roman">y1</font><font face="宋体">），（</font><font face="Times New Roman">x2</font><font face="宋体">，</font><font face="Times New Roman">y2</font><font face="宋体">）表示一个矩形的对顶角坐标。</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p></div><h2>Output</h2><div class=content><p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'">输出最小面积，或者<font face="Times New Roman">-1.</font></span><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<h3 style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 12pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></h3></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>【样例输入1】<br />
2<br />
<br />
1 0<br />
<br />
1 2<br />
<br />
3 4<br />
<br />
4 3<br />
<br />
<br />
【样例输入2】<br />
2<br />
<br />
0 1<br />
<br />
0 1<br />
<br />
2 3<br />
<br />
2 3<br />
<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>【样例输出1】<br />
3<br />
<br />
【样例输出2】<br />
-1<br />
<br />
<br />
</span></div><h2>HINT</h2>
			<div class=content><p><p><br /><br />
对于100%的数据，N &le;30 , |X|，|Y|&le;10000<br /><br />
</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=2010福建集训'>2010福建集训</a></p></div><center>[<a href='submitpage.php?id=2353'>Submit</a>][<a href='problemstatus.php?id=2353'>Status</a>][<a href='bbs.php?id=2353'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
